package com.zzb.controller;

import com.zzb.DTO.ResultDTO;
import com.zzb.VO.CommentVO;
import com.zzb.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ASUS
 */
@RestController
@CrossOrigin
@RequestMapping("/back/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;

    @GetMapping("/all")
    public ResultDTO productTypeFindAll(CommentVO commentVO) {
        return commentService.findAll(commentVO);
    }

    @GetMapping("/id")
    public ResultDTO productTypeFindById(CommentVO commentVO) {
        return commentService.findById(commentVO);
    }

    @PostMapping("/delete")
    public ResultDTO productDelete(CommentVO commentVO){
        return commentService.delete(commentVO);
    }
}
